home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / CPP / METAKIT.ZIP / INCLUDE / K4STRAT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-09  |  1.7 KB  |  58 lines

  1. //@doc      STRAT HDR CORE
  2. //@module   STRAT.H - Strategy declarations |
  3. //  
  4. //  This file contains the declaration of the strategy class.
  5. //  
  6. //@normal   Copyright <cp> 1996 Meta Four Software. All rights reserved.
  7.  
  8. #ifndef __K4STRAT_H__
  9. #define __K4STRAT_H__
  10.  
  11. /////////////////////////////////////////////////////////////////////////////
  12. // Declarations in this file
  13.  
  14.     class c4_Strategy;                  // system and file interface
  15.  
  16. /////////////////////////////////////////////////////////////////////////////
  17. //@class A strategy encapsulates code dealing with file I/O and the system.
  18.  
  19. class c4_Strategy
  20. {
  21. public: //@access Public members
  22.     //@cmember Constructs a new strategy object.
  23.     c4_Strategy ();
  24.     //@cmember Destructor.
  25.     virtual ~c4_Strategy ();
  26.  
  27.     //@cmember Open a data file by name.
  28.     virtual bool DataOpen(const char*, bool);
  29.  
  30.     //@cmember Set file position.
  31.     virtual void DataSeek(long);
  32.     //@cmember Read a number of bytes.
  33.     virtual int  DataRead(void*, int);
  34.     //@cmember Read an exact number of bytes.
  35.     virtual void DataLoad(void*, int);
  36.     //@cmember Write a number of bytes.
  37.     virtual void DataWrite(const void*, int);
  38.     //@cmember Flush and truncate file.
  39.     virtual void DataCommit(long);
  40.  
  41.     //@cmember Consume some bytes sequentially.
  42.     virtual int  StreamRead(void*, void*, int);
  43.     //@cmember Produce some bytes sequentially.
  44.     virtual void StreamWrite(void*, const void*, int);
  45.  
  46. protected: //@access Protected members
  47.     //@cmember Pointer to file object.
  48.     c4_File* _file;
  49.  
  50.     friend class c4_Storage;
  51. };
  52.  
  53. /////////////////////////////////////////////////////////////////////////////  
  54.  
  55. #endif
  56.  
  57. // $Id: k4strat.h,v 1.7 1996/12/08 11:22:32 jcw Exp $
  58.